package com.suneee.base.context;

import java.io.Serializable;
import java.sql.Timestamp;

import com.suneee.base.entity.DeviceType;
import com.suneee.component.cache.annotation.CacheType;
import com.suneee.component.cache.annotation.SuneeeCache;

@SuneeeCache(name="会话", code="session", idleSeconds = 3600, cacheType=CacheType.LOCALE, keyColumn="sessionId", forEver= false)
@SuppressWarnings("serial")
public class Session implements Serializable{

	/**
     * Session Id
     */
    private String sessionId;
    
    /**
     * Session IP
     */
    private String ip;
    
    /**
     * 客户端类型
     */
    private DeviceType deviceType;
    
    /**
     * 创建时间
     */
    private Timestamp createdTime;

    /**
     * 当前用户
     */
    private OnlineUser onlineUser;
    
    public Session(){
        
    }
    
    public Session(String sessionId, String ip, DeviceType deviceType, Timestamp createdTime){
        this.sessionId = sessionId;
        this.ip = ip;
        this.deviceType = deviceType;
        this.createdTime = createdTime;
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public DeviceType getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(DeviceType deviceType) {
        this.deviceType = deviceType;
    }

    public Timestamp getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Timestamp createdTime) {
        this.createdTime = createdTime;
    }

    public OnlineUser getOnlineUser() {
        return onlineUser;
    }

    public void setOnlineUser(OnlineUser onlineUser) {
        this.onlineUser = onlineUser;
    }
}
